package work20241126_27;

import java.util.Arrays;

/**
 * @author zdl
 * @date 2024/11/26
 */
public class Demo2 {
    public static void main(String[] args) {
        //数组反转[1,2,3,4]----->[4,3,2,1]
        int[] arr = {1,3,7,4};
        for (int i = 0; i < arr.length/2; i++) {
            int temp = arr[i];
            arr[i] = arr[arr.length-1-i];
            arr[arr.length-1-i] = temp;
        }
        System.out.println(Arrays.toString(arr));
    }
}
